package cn.hdu.liang.socket;

import java.net.MalformedURLException;
import java.net.URL;

public class URLTest1 {
    public static void main(String[] args) throws MalformedURLException {
        URL url = new URL("http://fanyi.baidu.com:80/#en/zh/");
        System.out.println("protocol: " + url.getProtocol());
        System.out.println("port    : " + url.getPort());
        System.out.println("host    : " + url.getHost());
        System.out.println("path    : " + url.getPath());
        System.out.println("file    : " + url.getFile());
        System.out.println("query   : " + url.getQuery());
        System.out.println("ref     : " + url.getRef());
    }
}